{$hooks}
<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                            <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                        {php}
                        \think\Hook::listen('xshop_admin_plugin_index_afterbtns');
                        {/php}
                        
                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           width="100%">
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>

{php}$api_url = get_addon_info('xshop')['api_url'];{/php}
<script id="operateTpl" type="text/html">
    <% var url =  '{$api_url}addons/xshopplugin/resources/down'; %>
    <div class="operate">
        <span class="btn-group">
            <a target="_blank" href="<%=url + '?name=' + row.items[0].name + '&version=' + row.items[0].version %>" class="btn btn-xs btn-primary btn-success"><i class="fa fa-cloud-download"></i> {:__('下载')}</a>
            <% if(row.items.length > 1) { %>
            <a class="btn btn-xs btn-success dropdown-toggle" data-toggle="dropdown" href="javascript:;">
                <span class="fa fa-caret-down"></span>
            </a>
            <ul class="dropdown-menu">
                <% for(var i = 0; i < row.items.length; i ++) { %>
                    <% var item = row.items[i]; %>
                <li>
                    <a href="<%=url + '?name=' + item.name + '&version=' +item.version  %>"><%=item.version %></a>
                </li>
                <% } %>
            </ul>
            <% } %>
        </span>
    </div>
</script>